package com.itawei.d3_threadmethod;

/**
 * 线程的优先级
 * setPriority()           设置线程的优先级
 * finla int getPriority() 获取线程的优先级
 */
public class ThreadMethodDemo2 {
    public static void main(String[] args) {
        MyRuunable mr = new MyRuunable();
        Thread t1 = new Thread(mr);
        Thread t2 = new Thread(mr);
        t1.setName("宁姚1");
        t2.setName("陈平安2");
        int p1 = t1.getPriority();
        System.out.println(p1);
        int p2 = t2.getPriority();
        System.out.println(p2);

        Thread t = Thread.currentThread();
        System.out.println(t.getPriority());
        t1.setPriority(10);
        t2.setPriority(1);
        t1.start();
        t2.start();

    }
}
